/*
 *
 *  * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 *
 *
 */

package com.iwindplus.base.async.cmd.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.iwindplus.base.async.cmd.domain.enums.CmdStatusEnum;
import com.iwindplus.base.async.cmd.domain.enums.DispatchModeEnum;
import com.iwindplus.base.domain.DbBaseDO;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 异步命令表.
 *
 * @author zengdegui
 * @since 2025/9/14
 */
@Schema(description = "异步命令对象")
@TableName(value = "`async_cmd`", autoResultMap = true)
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class AsyncCmdDO extends DbBaseDO {

    /**
     * 状态（INIT：初始化，EXECUTE：执行，SUCCESS：成功，ERROR：错误，DISCARD：丢弃）.
     */
    @Schema(description = "状态（INIT：初始化，EXECUTE：执行，SUCCESS：成功，ERROR：错误，DISCARD：丢弃）")
    private CmdStatusEnum cmdStatus;

    /**
     * 命令类型.
     */
    @Schema(description = "命令类型")
    private String cmdType;

    /**
     * 调度模式（DISPATCH：调度中心，EXECUTE：异步，UNKNOWN：未知）.
     */
    @Schema(description = "调度模式（DISPATCH：调度中心，EXECUTE：异步，UNKNOWN：未知）")
    private DispatchModeEnum dispatchMode;

    /**
     * 业务流水号.
     */
    @Schema(description = "业务流水号")
    private String bizNumber;

    /**
     * 内容.
     */
    @Schema(description = "内容")
    private String content;

    /**
     * 执行次数.
     */
    @Schema(description = "执行次数")
    private Long executeCount;

    /**
     * 下次执行时间.
     */
    @Schema(description = "下次执行时间")
    private LocalDateTime nextExecuteTime;
}
